A série de mangá e anime Yu-Gi-Oh! introduz o jogo de cartas colecionáveis original criado por Kazuki Takahashi, desenvolvido e publicado pela Konami.
O jogo começou a ser produzido em 1998, e hoje é jogado no mundo inteiro. O jogo possui algumas diferenças quanto ao fictício, pois este servia para se adequar ao enredo. Takahashi começou a fazer as cartas em 1996.
Em agosto de 2008, a TV Tokyo relatou que o jogo de cartas da série já vendeu mais de 18 milhões de cartas em todo o mundo.[33] Em 9 de junho de 2009, em seu aniversário de 10 anos, foi adicionado ao Guinness World Records como o jogo de cartas mais bem sucedido, tendo vendido mais de 22 bilhões e meio de cartas ao redor do mundo desde o início de sua fabricação.[34]
Em 31 de março de 2011, a Konami já vendeu mais de 25 milhões de cartões em todo o mundo desde 1999.[35] O jogo continua a ganhar popularidade, já que é jogado em todo o mundo, principalmente no Japão, América do Norte, Europa e Austrália, e foi ampliado com novas regras e adições conforme a franquia cresce.
A esfera que representa o nível do monstro. O jogo de cartas - cujo nome original é Yu-Gi-Oh! Trading Card Game (遊☆戯☆王 オフィシャルカードゲーム em japonês, Yū☆Gi☆Ō turadingu Kādo Gēmu em rōmaji, abreviado como TCG) - é baseado em batalhas de monstros e ativação de efeitos bônus e armadilhas num duelo entre 2 oponentes, cada um possuindo 8000 LPs (Life Points, ou Pontos de Vida) e usando Decks (baralhos) de 40 a 60 cartas.
O perdedor é aquele que tem seus pontos de vida reduzidos à zero,[36] ou quem não tiver mais cartas para puxar.[37]
Tradicional: Neste formato de duelo, quase todas as cartas existentes desde a primeira coleção (Legend of Blue-Eyes Dragon) até a mais recente são permitidas para jogar - exceto cartas "banidas" conforme uma lista periódica (anteriormente semestral ou trimestral, agora sem um período fixo) publicada pela Konami. Normalmente, pessoas que jogam neste formato usam decks de First Turn Kill (onde não há chance de o oponente jogar se a estratégia do Deck tiver sucesso), One Turn Kill (onde o oponente tem seus pontos de vida reduzidos a 0 num mesmo turno) e decks com cartas limitadas e restritas.[38]
Avançado: Neste formato, mais largamente utilizado nos torneios, há maior limitação das cartas permitidas para uso (algumas cartas são limitadas a 2 ou 1 por Deck). Por causa disto, aqui predominam os Decks baseados no controle da partida através da interrupção das investidas do oponente (ou "controle de campo") ou remoção de cartas.[39]
Os campeonatos mais conhecidos e movimentados são Yu-Gi-Oh! World Championship e Yu-Gi-Oh! Championship Series, ou YCS, mas há outros tipos de campeonatos, como a "Pegasus League" (com regras próprias e variadas a cada torneio), "Sneak Peek" (torneios de Decks montados com a coleção mais recente),"Dragon Duel" (com crianças até 12 anos),World Championship Qualifier;ou WCQ, Yu-Gi-Oh! Day e Ultimate Duelist Series, ou UDS.

#install.packages('tidyverse')
#install.packages('ggExtra')
#install.packages('repr')
#install.packages('treemap')
#install.packages('ggalt')
#install.packages('ggfortify')
#install.packages('RColorBrewer')
#install.packages("viridis")
library(tidyverse)
library(repr)
library(RColorBrewer)
library(viridis)
library(ggExtra)
library(treemap)
library(ggalt)
library(ggfortify)
Vc pode baixar do GitHub ou baixar o arquivo e salvar na sua máquina vou fazer aqui pelos dois métodos
url = 'https://raw.githubusercontent.com/DeepFluxion/Analise_Dados_Linguagem_R/master/data/ygo.csv'
ygo <- read.csv(url)
ygo <- read.csv(file = 'data/ygo.csv')
names(ygo)<-c('ID','Nome','Ataque','Atributo','Defesa','has_materials',
'has_name_condition','is_extra_deck','is_fusion','is_link','is_pendulum',
'is_synchro','is_xyz','link_markers','link_number','materiais','monster_types','name_condition',
'numero','pendulum_left','pendulum_right','pendulum_text','lancamentos','Tipo','estrelas','texto')
Para começar, vamos fazer uma análise para ter uma ideia dos dados.
Em primeiro lugar, quais dados realmente temos?
O lugar mais fácil para começar, são os 3 valores numéricos mais óbvios quando se olha para uma carta, o ataque, a defesa e as estrelas (nível / classificação). Isso dá a você uma ideia geral do poder da carta, sem considerar seu efeito. Claro, sem o efeito considerado, você não obtém a imagem completa.
Tmabém vamos trabalhar com Atributo e Tipo que parecem bem interssante de se explorar
g<- ygo %>%
count(Atributo, sort = TRUE)
g
| Atributo | n |
|---|---|
| <chr> | <int> |
| DARK | 1614 |
| EARTH | 1491 |
| LIGHT | 1212 |
| WATER | 598 |
| WIND | 552 |
| FIRE | 472 |
| DIVINE | 10 |
options(repr.plot.width=7, repr.plot.height=7)
ggplot(data = g, aes(x=reorder(Atributo, -n), y=n))+
geom_bar(stat="identity")+
theme_minimal()+
theme(text = element_text(size = 20))+
ylab('QTD')+
xlab('Atributo')
g<- ygo %>%
count(Tipo, sort = TRUE)
g
| Tipo | n |
|---|---|
| <chr> | <int> |
| Warrior | 821 |
| Machine | 699 |
| Fiend | 592 |
| Spellcaster | 506 |
| Dragon | 464 |
| Fairy | 358 |
| Beast | 300 |
| Winged Beast | 247 |
| Aqua | 197 |
| Insect | 193 |
| Rock | 190 |
| Beast-Warrior | 186 |
| Zombie | 173 |
| Plant | 171 |
| Reptile | 136 |
| Psychic | 122 |
| Pyro | 108 |
| Fish | 98 |
| Thunder | 97 |
| Dinosaur | 88 |
| Cyberse | 80 |
| Sea Serpent | 62 |
| Wyrm | 51 |
| Divine-Beast | 8 |
| Creator God | 2 |
options(repr.plot.width=20, repr.plot.height=7)
ggplot(data = g, aes(x=reorder(Tipo, -n), y=n))+
geom_bar(stat="identity")+
theme_minimal()+
theme(text = element_text(size = 20,angle = 90))+
ylab('QTD')+
xlab('Tipo')
ygo %>%
group_by(Atributo)%>%
summarise(mean(Ataque,na.rm = TRUE),
mean(Defesa,na.rm = TRUE),
mean(estrelas,na.rm = TRUE))
`summarise()` ungrouping output (override with `.groups` argument)
| Atributo | mean(Ataque, na.rm = TRUE) | mean(Defesa, na.rm = TRUE) | mean(estrelas, na.rm = TRUE) |
|---|---|---|---|
| <chr> | <dbl> | <dbl> | <dbl> |
| DARK | 1531.067 | 1209.015 | 4.746052 |
| DIVINE | 4000.000 | 4000.000 | 10.222222 |
| EARTH | 1372.546 | 1206.550 | 4.162457 |
| FIRE | 1573.134 | 1152.065 | 4.526998 |
| LIGHT | 1601.266 | 1323.865 | 4.713922 |
| WATER | 1405.705 | 1236.041 | 4.138514 |
| WIND | 1409.909 | 1203.033 | 4.192308 |
ygo %>%
group_by(Tipo)%>%
summarise(mean(Ataque,na.rm = TRUE),
mean(Defesa,na.rm = TRUE),
mean(estrelas,na.rm = TRUE))
`summarise()` ungrouping output (override with `.groups` argument)
| Tipo | mean(Ataque, na.rm = TRUE) | mean(Defesa, na.rm = TRUE) | mean(estrelas, na.rm = TRUE) |
|---|---|---|---|
| <chr> | <dbl> | <dbl> | <dbl> |
| Aqua | 1149.239 | 1176.5306 | 3.719388 |
| Beast | 1267.726 | 1092.5926 | 3.855705 |
| Beast-Warrior | 1634.167 | 1162.5698 | 4.432432 |
| Creator God | NaN | NaN | 12.000000 |
| Cyberse | 1427.500 | 1002.0833 | 3.458333 |
| Dinosaur | 1756.977 | 1219.8851 | 4.750000 |
| Divine-Beast | 4000.000 | 4000.0000 | 10.000000 |
| Dragon | 2111.087 | 1633.9207 | 6.052980 |
| Fairy | 1467.887 | 1284.5029 | 4.649275 |
| Fiend | 1442.151 | 1106.1391 | 4.466552 |
| Fish | 1353.061 | 1073.4694 | 4.010204 |
| Insect | 1134.635 | 1042.7419 | 3.668449 |
| Machine | 1441.691 | 1353.1341 | 4.723589 |
| Plant | 1179.240 | 1060.2941 | 3.511765 |
| Psychic | 1577.049 | 1246.6667 | 4.300000 |
| Pyro | 1424.762 | 950.9524 | 4.250000 |
| Reptile | 1292.105 | 1026.6667 | 4.191176 |
| Rock | 1381.383 | 1398.3957 | 4.306878 |
| Sea Serpent | 1762.097 | 1269.6721 | 4.377049 |
| Spellcaster | 1317.369 | 1189.4309 | 4.032129 |
| Thunder | 1373.158 | 1059.7938 | 4.237113 |
| Warrior | 1619.756 | 1296.1063 | 4.627936 |
| Winged Beast | 1358.740 | 1128.2520 | 4.235772 |
| Wyrm | 1955.882 | 1645.9184 | 5.693878 |
| Zombie | 1506.509 | 895.9064 | 4.168605 |
options(repr.plot.width=10, repr.plot.height=10)
c<- ygo %>%
count(Atributo, sort = TRUE)
treemap(c,
index="Atributo",
vSize="n",
type="index")
options(repr.plot.width=10, repr.plot.height=10)
c<- ygo %>%
count(Tipo, sort = TRUE)
treemap(c,
index="Tipo",
vSize="n",
type="index")
g<- ygo %>%
group_by(Tipo)%>%
count(Atributo, sort = TRUE)
options(repr.plot.width=10, repr.plot.height=10)
treemap(g, #Your data frame object
index=c("Atributo","Tipo"), #A list of your categorical variables
vSize = "n", #This is your quantitative variable
type="index", #Type sets the organization and color scheme of your treemap
palette = "Paired", #Select your color palette from the RColorBrewer presets or make your own.
title="Divisão po Atributo e Tipo", #Customize your title
fontsize.title = 20 #Change the font size of the title
)
options(repr.plot.width=20, repr.plot.height=7)
ggplot(data = g, aes(x=reorder(Tipo, -n), y=n, fill=Atributo))+
geom_bar(stat="identity")+
theme_minimal()+
theme(text = element_text(size = 24,angle = 90),legend.position="bottom")+
ylab('QTD')+
xlab('Tipo')
options(repr.plot.width=25, repr.plot.height=7)
ggplot(data = g, aes(x=reorder(Tipo, -n), y=n, fill=Atributo))+
geom_bar(stat="identity", position=position_dodge())+
theme_minimal()+
theme(text = element_text(size = 20,angle = 90),legend.position="bottom")+
ylab('QTD')+
xlab('Tipo')
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=Ataque)) +
geom_histogram(fill="blue", color="black", na.rm=TRUE, bins = 10)+
theme(text = element_text(size = 20))
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=Ataque)) +
geom_density(fill="blue", color="black", alpha=0.5, na.rm = TRUE)+
theme(text = element_text(size = 20))
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=Defesa)) +
geom_histogram(fill="red", color="black", na.rm=TRUE, bins = 10)+
theme(text = element_text(size = 24))
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=Defesa)) +
geom_density(fill="red", color="black", alpha=0.5, na.rm = TRUE)+
theme(text = element_text(size = 20))
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=estrelas)) +
geom_histogram(fill="green", color="black", na.rm=TRUE, bins=12)+
theme(text = element_text(size = 20))
options(repr.plot.width=20, repr.plot.height=5)
ggplot(ygo, aes(x=estrelas)) +
geom_density(fill="green", color="black", alpha=0.5, na.rm = TRUE)+
theme(text = element_text(size = 20))
options(repr.plot.width=8, repr.plot.height=7)
ggplot(ygo, aes(x=Ataque, y=Defesa)) +
geom_point(
color="black",
fill="blue",
shape=21,
alpha=0.8,
size=6
)+
theme(text = element_text(size = 20))
Warning message: "Removed 176 rows containing missing values (geom_point)."
options(repr.plot.width=10, repr.plot.height=7)
ggplot(ygo, aes(x=Ataque, y=Defesa, color=estrelas))+
geom_point(size=6, na.rm = TRUE) +
theme_gray()+
#scale_color_viridis(option = "D")+
theme(text = element_text(size = 20))+
scale_colour_gradient2(low = "green4",mid = "yellow",high = "red2",midpoint = 6)
ggplot(ygo, aes(x=Ataque, y=Defesa, z = estrelas))+
geom_density_2d_filled(na.rm = TRUE)+
geom_density_2d(color='white', na.rm = TRUE)+
theme(text = element_text(size = 20))
ggplot(ygo, aes(x=Ataque, y=Defesa, z = estrelas))+
geom_density_2d_filled(na.rm = TRUE)+
geom_density_2d(color='white', na.rm = TRUE)+
theme(text = element_text(size = 20))+
geom_point(color='white', alpha=0.05, aes(size=estrelas), na.rm = TRUE)
options(repr.plot.width=20, repr.plot.height=7)
ygo %>%
ggplot( aes(x=Atributo, y=Ataque, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
scale_fill_viridis(discrete = TRUE, alpha=0.6, option="D") +
theme_gray() +
theme(text = element_text(size = 24))+
ggtitle("Ataque por Atributos") +
xlab("")
options(repr.plot.width=20, repr.plot.height=7)
ygo %>%
ggplot( aes(x=Atributo, y=Ataque, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
scale_fill_viridis(discrete = TRUE, alpha=0.6, option="D") +
geom_jitter(color="black", size=5.4, alpha=0.09, na.rm = TRUE) +
theme_gray() +
theme(text = element_text(size = 20))+
ggtitle("Ataque por Atributos") +
xlab("")
options(repr.plot.width=20, repr.plot.height=7)
ygo %>%
ggplot( aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
scale_fill_viridis(discrete = TRUE, alpha=0.6, option="D") +
theme_gray() +
theme(text = element_text(size = 20))+
ggtitle("Defesa por Atributos") +
xlab("")
options(repr.plot.width=20, repr.plot.height=7)
ygo %>%
ggplot( aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
scale_fill_viridis(discrete = TRUE, alpha=0.6, option="D") +
theme_gray() +
theme(text = element_text(size = 20))+
geom_jitter(color="black", size=5.4, alpha=0.15, na.rm = TRUE)+
ggtitle("Defesa por Atributos") +
xlab("")
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Ataque, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Ataque, fill=Atributo)) +
geom_violin(na.rm = TRUE) +
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Ataque, fill=Atributo)) +
geom_violin(na.rm = TRUE) +
geom_jitter(color="black", size=5.4, alpha=0.35, na.rm = TRUE)+
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_violin(na.rm = TRUE) +
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_violin(na.rm = TRUE) +
geom_jitter(color="black", size=5.4, alpha=0.35, na.rm = TRUE)+
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Tipo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Tipo, y=Defesa, fill=Tipo)) +
geom_boxplot(na.rm = TRUE) +
geom_jitter(color="black", size=5.4, alpha=0.05, na.rm = TRUE)+
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~Atributo)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_boxplot(na.rm = TRUE) +
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~estrelas)
options(repr.plot.width=20, repr.plot.height=20)
ggplot(ygo, aes(x=Atributo, y=Defesa, fill=Atributo)) +
geom_violin(na.rm = TRUE) +
geom_jitter(color="black", size=5.4, alpha=0.05, na.rm = TRUE)+
theme_gray()+
theme(text = element_text(size = 16))+
facet_wrap(~estrelas)
Warning message in max(data$density): "nenhum argumento não faltante para max; retornando -Inf" Warning message: "Computation failed in `stat_ydensity()`: replacement has 1 row, data has 0"
options(repr.plot.width=10, repr.plot.height=10)
g<-ggplot(ygo, aes(Ataque, estrelas)) +
geom_count(na.rm = TRUE) +
geom_smooth(method="lm", se=TRUE, na.rm = TRUE)+
theme_bw()+
theme(text = element_text(size = 16))
ggMarginal(g, type = "histogram", fill="transparent", na.rm=TRUE)
`geom_smooth()` using formula 'y ~ x' `geom_smooth()` using formula 'y ~ x'
options(repr.plot.width=10, repr.plot.height=10)
g<-ggplot(ygo, aes(Defesa, estrelas)) +
geom_count(na.rm = TRUE) +
geom_smooth(method="lm", se=TRUE, na.rm = TRUE)+
theme(text = element_text(size = 16))
ggMarginal(g, type = "histogram", fill="transparent", na.rm=TRUE)
`geom_smooth()` using formula 'y ~ x' `geom_smooth()` using formula 'y ~ x'